package hello;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

public class Robo {

     private int xrobo;
    private int yrobo;
    private int pos;
    private int cont;
    protected int width;
    protected int height;
    private int numero;



    public Robo () {
        xrobo = 0;
        yrobo = 0;

    }
    public  Robo(int x, int y, int width, int height){
        this.xrobo=x;
        this.yrobo=y;
        this.width=width;
        this.height=height;

    }

    public void draw(Graphics g) {
        g.setColor(250,0,0);
        g.fillArc(xrobo,yrobo, width, height,30, 300);



    }

    public void mover ( int numero,int screenH, int screenW){
        if(numero == 1){
         //  if( yrobo-height<= screenH)
            if(yrobo<=0)
                  yrobo = 0;
               else
                  yrobo -= 10;//28;
         }

         if(numero == 2){
           // if( yrobo-height>= screenH)
             if(yrobo>=screenH)
                  yrobo = screenH;
               else
             yrobo += 10;//28;

        }
         if(numero == 3){
            //if( xrobo-width>= screenW)
             if(xrobo<=0)
                  xrobo += 0;
               else
             xrobo -=10;

        }
         if(numero == 4){
           // if( xrobo-width>= screenW)
             if(xrobo>=screenW)
                  xrobo = screenW;
               else
             xrobo+= 10;

        }
    }
}
